package my.maven.project.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import my.maven.project.entity.Organization;
import my.maven.project.service.OrganizationService;

@RestController
@RequestMapping("/api/org")
@Scope("prototype") //singleton prototype session request globalSession
public class ApiOrgController {

	@Autowired
	private OrganizationService _organizationService;
	
	@RequestMapping("list")
	public List<Organization> list()
	{
		return _organizationService.getAll();
	}
	
	@RequestMapping("get")
	public  Organization getone(Long id)
	{
		return _organizationService.getOne(id);
	}
	
	
	
	
}
